package com.ygou.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ygou.mapper.SlideMapper;
import com.ygou.pojo.Slide;
import com.ygou.pojo.SlideExample;
import com.ygou.service.SlideService;
@Service
public class SlideServiceImpl implements SlideService{
	@Autowired
	SlideMapper sm;
	@Override
	public List<Slide> showAll() {
		
		return sm.selectByExample(new SlideExample());
	}

	@Override
	public boolean del(int id) {
		return sm.deleteByPrimaryKey(id)>0;
	}

	@Override
	public boolean upd(Slide s) {
		// TODO Auto-generated method stub
		return sm.updateByPrimaryKeySelective(s)>0;
	}

	@Override
	public boolean add(Slide s) {
		// TODO Auto-generated method stub
		return sm.insertSelective(s)>0;
	}

	@Override
	public Slide selById(int id) {
		// TODO Auto-generated method stub
		return sm.selectByPrimaryKey(id);
	}
}
